package com.yl.chainStore.mapper.customer

import com.baomidou.mybatisplus.core.mapper.BaseMapper
import com.baomidou.mybatisplus.extension.plugins.pagination.Page
import com.yl.chainStore.entity.customer.CustomerInfo
import com.yl.chainStore.pojo.vo.customer.CustomerSelectVo
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Param

@Mapper
interface CustomerInfoMapper : BaseMapper<CustomerInfo> {

	/**
	 * id查询
	 */
	fun selectById(@Param("id")id:Long):CustomerInfo?

    /**
     * 查询列表
     */
    fun selectCustomerList(@Param("vo") vo: CustomerSelectVo): List<CustomerInfo>

    /**
     * 分页查询
     */
    fun selectCompanyCustomerPage(
            @Param("page") page: Page<CustomerInfo>,
            @Param("vo") vo: CustomerSelectVo
    ): Page<CustomerInfo>

    /**
     * 获取今日新增患者
     */
    fun getTodayNewCustomer(@Param("deptId") deptId: Long): Int

	/**
	 * 分页查询用户客户
	 */
	fun selectUserCustomerPage(
		@Param("page") page: Page<CustomerInfo>,
		@Param("vo") vo: CustomerSelectVo,
		@Param("userId")userId:Long,
		@Param("companyId")companyId:Long
	): Page<CustomerInfo>

	/**
	 * 按名字查询分院患者（导入数据时候使用）
	 */
	fun selectDeptCustomerByName(@Param("name")name:String,
								 @Param("subCompanyId")subCompanyId:Long,
								@Param("sickNum")sickNum:String?):List<CustomerInfo>

}
